package com.mgkj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mgkj.dto.*;
import com.mgkj.dto.yf.MoMaterialDto;
import com.mgkj.entity.Cmsmq;
import com.mgkj.entity.MoInstorageSummary;
import com.mgkj.entity.yf.InitMocta;
import com.mgkj.entity.yf.InitMoctb;
import com.mgkj.vo.IssueReceiptReqVo;
import com.mgkj.vo.MaxGxVo;
import com.mgkj.vo.MoInStorageVo;
import com.mgkj.vo.issueReceiptReqDVo;
import com.mgkj.vo.yf.MoMaterialVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @author yyyjcg
 * @date 2024/3/8
 * @Description
 */
@Mapper
public interface MoMapper extends BaseMapper {

    List<String> getWarehouseCodeByEmployeeNo(@Param("employeeNo") String employeeNo);
    List<IssueReceiptReqVo> getIssueReceiptReq(IssueReceiptReqDto pageDTO);
    List<IssueReceiptWarehouse> getIssueReceiptWarehouseList(@Param("docNoList")List<String> docNoList);
    List<issueReceiptReqDVo> getIssueReceiptReqD(IssueReceiptReqDDto dto);


//    List<MoInStorageVo> selectListMoInStorage(MoInStorageDto dto);

    MoInStorageVo selectMoInStorage(MoInStorageDto dto);

    MaxGxVo getMaxGxNo(MoInStorageVo vo);

    String selectTA021(@Param("docNo")String docNo);

    List<MoInStorageVo> queryMoInStorageSummary(@Param("createBy") String createBy, @Param("barcode") String barcode);

    int insertMoInStorageSummary(@Param("dto") MoInStorageVo dto, @Param("createBy") String createBy);

    void deleteMoInStorageSummary(@Param("id") String id);

    void deleteMoInStorageSummaryByCreatBy(String createBy);

    @Update("UPDATE bm_barcode_detail SET lot_att30 ='4' WHERE barcode = #{barcode}")
    int updateBarcodeWBU(MoInStorageSubmitDto listDto);

    List<InitMocta> queryMocta(MoMaterialDto dto);

    List<InitMoctb> queryMoctb(MoMaterialDto dto);

    List<Cmsmq> queryMaterialDocType();

    List<InitMoctb> queryMoctbByKeys(List<Map<String, String>> keyList);

    void updateMoInStorageSummary(MoInstorageSummary dto);

    String selectWorkCenter(String s, String s1);

    InitMocta selectMocta(String gddb, String gddh);

    @Select("SELECT TA033 FROM MOCTA WHERE TA001 = #{db} AND TA002 = #{dh}")
    String selectLotCode(String db, String dh);

    void moInStorageSummaryInsertMoDate(@Param("idList") List<String> idList, String insertMoDate);

    String selectDocNo(String db, String dh);
}
